<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="cn.itcast.User"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>el表达式运算符</title>
  </head>
  
  <body>
    
    ${365*24 }
    
    ${user==null }
    
   	<br/>
    
    <% 
    	List list = null;
    	//List list = new ArrayList();
    	//list.add("a");
    	//list.add("b");
    	
    	request.setAttribute("list",list);
    %>
    
    <c:if test="${!empty(list)}">
    	<c:forEach var="str" items="${list}">
    		${str }
    	</c:forEach>
    </c:if>
    
    <c:if test="${empty(list)}">
    	对不起，没有您想看的数据
    </c:if>
    
    
    <br/>
    
    <% 
    	session.setAttribute("user",new User("vvvv"));
    %>
    ${user==null? "对不起，您没有登陆 " : user.username }
    
    
    <br/>
    
    <% 
    	User user = new User();
    	user.setGender("male");
    	
    	//数据回显
    	request.setAttribute("user",user);
    %>
    
   	
   	<input type="radio" name="gender" value="male" ${user.gender=='male'?'checked':'' }>男
   	<input type="radio" name="gender" value="female" ${user.gender=='female'?'checked':'' }>女
   
   
   <br/>
   
    <% 
    	user = new User();
    	String likes[] = {"sing","dance","football"};
    	user.setLikes(likes);
    	
    	//数据回显  在5.jsp中有 实现方法
    	request.setAttribute("user",user);
    %>
    
    
    <input type="checkbox" name="like" vlaue="sing">唱歌
     <input type="checkbox" name="like" value="dance">跳舞
      <input type="checkbox" name="like" value="basketball">蓝球
       <input type="checkbox" name="like" value="football">足球
   
    
  </body>
</html>
